import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AndJstMapVO, AndJstMapForm, AndJstMapQuery } from '@/api/data-check/andJstMap/types';

/**
 * 查询金蝶和聚水潭映射列表
 * @param query
 * @returns {*}
 */

export const listAndJstMap = (query?: AndJstMapQuery): AxiosPromise<AndJstMapVO[]> => {
  return request({
    url: '/dataCheck/andJstMap/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶和聚水潭映射详细
 * @param id
 */
export const getAndJstMap = (id: string | number): AxiosPromise<AndJstMapVO> => {
  return request({
    url: '/dataCheck/andJstMap/' + id,
    method: 'get'
  });
};

/**
 * 新增金蝶和聚水潭映射
 * @param data
 */
export const addAndJstMap = (data: AndJstMapForm) => {
  return request({
    url: '/dataCheck/andJstMap',
    method: 'post',
    data: data
  });
};

/**
 * 修改金蝶和聚水潭映射
 * @param data
 */
export const updateAndJstMap = (data: AndJstMapForm) => {
  return request({
    url: '/dataCheck/andJstMap',
    method: 'put',
    data: data
  });
};

/**
 * 删除金蝶和聚水潭映射
 * @param id
 */
export const delAndJstMap = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/andJstMap/' + id,
    method: 'delete'
  });
};
